<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>心情盒子小程序原型</title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
  <style>
    :root {
      --main-bg: linear-gradient(135deg, #e0f7fa 0%, #fceabb 100%);
      --card-bg: #fff;
      --primary: #6dd5ed;
      --primary-dark: #2193b0;
      --accent: #ffb347;
      --accent-dark: #ffa726;
      --text-main: #222;
      --text-sub: #888;
      --border-radius: 22px;
      --nav-radius: 28px;
      --shadow: 0 4px 24px 0 rgba(173,216,230,0.10);
    }
    body {
      font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
      background: var(--main-bg);
      margin: 0;
      color: var(--text-main);
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .phone-frame {
      background: linear-gradient(135deg, #f8fafc 0%, #e0e3eb 100%);
      border-radius: 48px;
      box-shadow: 0 8px 48px 0 rgba(80,80,80,0.10), 0 1.5px 0 #e0e0e0 inset;
      padding: 24px 10px 32px 10px;
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 430px;
      min-height: 900px;
      position: relative;
      border: 2.5px solid #e6e6e6;
    }
    .phone-notch {
      width: 90px;
      height: 12px;
      background: #d1d5db;
      border-radius: 0 0 12px 12px;
      margin: 0 auto 12px auto;
      position: relative;
      top: 0;
      left: 0;
      right: 0;
      z-index: 2;
      box-shadow: 0 2px 6px #e0e0e0;
    }
    .container {
      max-width: 390px;
      min-height: 780px;
      background: #f7fafc;
      border-radius: 36px;
      position: relative;
      padding-bottom: 90px;
      box-shadow: 0 2px 16px 0 rgba(173,216,230,0.10);
      margin: 0 auto;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      align-items: stretch;
    }
    /* 首页新布局 */
    .home-section {
      margin: 0 0 18px 0;
      padding: 0 0 0 0;
      display: flex;
      flex-direction: column;
      gap: 18px;
    }
    .home-card {
      background: var(--card-bg);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      margin-bottom: 0;
      padding: 20px 18px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      width: 100%;
      box-sizing: border-box;
    }
    .home-row {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    .home-date {
      font-size: 18px;
      font-weight: bold;
      color: var(--primary-dark);
      display: flex;
      align-items: center;
    }
    .home-date .fa-calendar { color: var(--accent); margin-right: 8px; }
    .home-weather {
      font-size: 15px;
      color: var(--primary-dark);
      display: flex;
      align-items: center;
    }
    .home-weather .fa-cloud-sun { color: var(--primary); margin-right: 6px; }
    .home-quote {
      font-size: 15px;
      color: var(--text-sub);
      font-style: italic;
      margin: 8px 0 0 0;
      width: 100%;
      text-align: left;
    }
    .mood-summary {
      margin: 0 0 0 0; padding: 0;
      background: none;
      border-radius: var(--border-radius);
      display: flex; align-items: center; justify-content: flex-start;
      box-shadow: none;
      width: 100%;
      min-height: 48px;
    }
    .mood-summary .fa-face-smile { color: var(--accent); font-size: 22px; margin-right: 10px; }
    .mood-summary .summary-text { font-size: 15px; color: #444; }
    .edit-btn {
      margin: 18px 0 0 0; width: 100%;
      background: linear-gradient(90deg, var(--primary), var(--accent));
      color: #fff; border: none;
      border-radius: var(--border-radius);
      padding: 14px 0; font-size: 18px; font-weight: bold; cursor: pointer;
      box-shadow: 0 2px 12px #e0e0e0;
      transition: background 0.2s;
      letter-spacing: 1px;
    }
    .edit-btn:hover { background: linear-gradient(90deg, var(--primary-dark), var(--accent-dark)); }
    .date-picker { margin: 0 0 0 0; text-align: left; width: 100%; }
    .date-picker input {
      padding: 8px 16px; border-radius: var(--border-radius);
      border: 1px solid #e0e0e0; font-size: 15px; background: #f7fafc;
      box-shadow: 0 1px 4px #f0f0f0;
      margin-top: 8px;
    }
    .trend-card {
      background: var(--card-bg);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      padding: 18px 16px;
      margin-bottom: 0;
      text-align: center;
      color: var(--primary-dark);
      font-size: 15px;
      width: 100%;
      box-sizing: border-box;
    }
    /* 其他页面样式保持统一 */
    .page { display: none; padding: 28px 0 0 0; }
    .page.active { display: block; }
    .page-inner-card {
      background: var(--card-bg);
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      margin: 0 auto;
      padding: 32px 28px 28px 28px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      width: 90%;
      box-sizing: border-box;
    }
    h2 { text-align: center; color: var(--primary-dark); margin-bottom: 24px; width: 100%; }
    .form-group {
      margin-bottom: 22px;
      width: 100%;
    }
    .form-group label {
      display: block;
      margin-bottom: 10px;
      color: #666;
      font-size: 15px;
    }
    .form-group textarea, .form-group input[type="text"] {
      width: 100%; min-height: 48px; border-radius: var(--border-radius);
      border: 1px solid #e0e0e0; padding: 10px; font-size: 15px; background: #f7fafc;
      box-shadow: 0 1px 4px #f0f0f0;
    }
    .form-group input[type="file"] {
      display: block;
      margin-top: 6px;
      border: 1px solid #e0e0e0;
      border-radius: 12px;
      padding: 8px 12px;
      background: #f7fafc;
      color: #888;
      font-size: 15px;
    }
    .emotion-row {
      display: flex; align-items: center; justify-content: center;
      gap: 22px;
      margin: 10px 0;
    }
    .emotion-row .fa {
      font-size: 30px;
      padding: 10px;
      border-radius: 50%;
      background: #f7fafc;
      transition: box-shadow 0.2s, background 0.2s, border 0.2s;
      border: 2px solid transparent;
    }
    .emotion-row .fa.selected {
      color: #ffb347;
      background: #fff3e0;
      box-shadow: 0 2px 8px #ffe0b2;
      border: 2px solid #ffb347;
    }
    .slider-row {
      display: flex; align-items: center; gap: 14px;
    }
    .slider-row input[type="range"] {
      flex: 1;
      accent-color: #6dd5ed;
      height: 4px;
    }
    #intensityValue {
      min-width: 24px;
      text-align: center;
      font-weight: bold;
      color: #2193b0;
    }
    .form-actions {
      display: flex; gap: 18px; width: 100%;
      margin-top: 28px;
    }
    .form-actions button {
      flex: 1; padding: 14px 0; border-radius: var(--border-radius);
      border: none; font-size: 18px; font-weight: bold; cursor: pointer;
      box-shadow: 0 1px 4px #f0f0f0;
    }
    .form-actions .submit {
      background: linear-gradient(90deg, #6dd5ed, #ffb347);
      color: #fff;
      border: none;
      border-radius: 22px;
      font-size: 18px;
      font-weight: bold;
      box-shadow: 0 2px 8px #e0e0e0;
    }
    .form-actions .cancel {
      background: #f7fafc;
      color: #888;
      border: 1px solid #e0e0e0;
      border-radius: 22px;
      font-size: 18px;
    }
    /* AI分析页 */
    .ai-result { text-align: center; margin-top: 0; width: 100%; }
    .ai-result .fa { font-size: 44px; margin-bottom: 12px; color: var(--accent); }
    .ai-result .score { font-size: 22px; font-weight: bold; color: var(--accent); margin: 8px 0; }
    .ai-result .tags { margin: 10px 0; }
    .ai-result .tag { display: inline-block; background: #ffe0b2; color: #ff9800; border-radius: 16px; padding: 6px 16px; margin: 0 4px; font-size: 15px; }
    .ai-result .desc { margin: 16px 0 0 0; color: #666; font-size: 16px; }
    /* 历史页 */
    .history-list { margin: 32px 0 0 0; width: 100%; display: flex; flex-direction: column; gap: 18px; }
    .history-item {
      background: var(--card-bg);
      border-radius: var(--border-radius);
      padding: 20px 18px;
      margin-bottom: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 4px 18px 0 rgba(173,216,230,0.13);
      transition: box-shadow 0.18s, background 0.18s;
      gap: 12px;
    }
    .history-item .date {
      color: var(--text-sub);
      font-size: 15px;
      min-width: 90px;
      text-align: left;
    }
    .history-item .summary {
      color: #444;
      font-size: 16px;
      flex: 1;
      text-align: left;
      margin: 0 10px;
    }
    .history-item .fa-trash {
      color: #e57373;
      cursor: pointer;
      margin-left: 10px;
      border-radius: 50%;
      padding: 8px;
      font-size: 22px;
      background: #fff3f3;
      transition: background 0.2s, box-shadow 0.2s;
      box-shadow: 0 2px 8px #ffe0e0;
      border: 1.5px solid #ffe0e0;
    }
    .history-item .fa-trash:hover {
      background: #ffe0e0;
      box-shadow: 0 4px 12px #ffd6d6;
    }
    .page-inner-card h2 {
      margin-bottom: 22px;
      font-size: 22px;
      color: var(--primary-dark);
      text-align: center;
      width: 100%;
    }
    .date-picker {
      margin: 0 0 18px 0;
      text-align: left;
      width: 100%;
    }
    .date-picker input {
      padding: 8px 16px;
      border-radius: var(--border-radius);
      border: 1px solid #e0e0e0;
      font-size: 15px;
      background: #f7fafc;
      box-shadow: 0 1px 4px #f0f0f0;
      margin-top: 8px;
      width: 100%;
      max-width: 220px;
    }
    /* 登录/隐私页 */
    .login-box { text-align: center; margin-top: 0; width: 100%; }
    .login-box .fa-user-circle { font-size: 60px; color: var(--accent); margin-bottom: 18px; }
    .login-box button {
      background: linear-gradient(90deg, var(--primary), var(--accent)); color: #fff; border: none;
      border-radius: var(--border-radius); padding: 14px 40px; font-size: 18px; font-weight: bold; cursor: pointer; margin-top: 18px;
      box-shadow: 0 2px 8px #e0e0e0;
    }
    .privacy { margin: 32px 0 0 0; color: var(--text-sub); font-size: 14px; text-align: center; width: 100%; }
    /* 底部导航栏 */
    nav {
      display: flex; justify-content: space-around;
      background: rgba(255,255,255,0.98);
      border-top: none;
      position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
      width: 92%; max-width: 350px;
      box-shadow: 0 4px 24px 0 rgba(173,216,230,0.18);
      border-radius: var(--nav-radius);
      z-index: 10;
      padding: 0 0;
      height: 64px;
    }
    nav button {
      background: none; border: none; padding: 0; flex: 1;
      font-size: 15px; color: var(--text-sub); cursor: pointer;
      border-radius: var(--nav-radius);
      height: 64px;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      transition: background 0.18s, color 0.18s;
    }
    nav button.active, nav button:hover {
      color: var(--primary-dark);
      background: linear-gradient(90deg, #e0f7fa 0%, #fffde4 100%);
    }
    nav i { font-size: 22px; margin-bottom: 2px; }
    @media (max-width: 480px) {
      .phone-frame { width: 100vw; min-height: 100vh; border-radius: 0; padding: 0; }
      .container, nav { max-width: 100vw; }
      nav { left: 0; transform: none; width: 98vw; }
    }
  </style>
</head>
<body>
  <div class="phone-frame">
    <div class="phone-notch"></div>
    <div class="container">
      <!-- 首页 -->
      <div class="page" id="homePage">
        <div class="home-section">
          <div class="home-card">
            <div class="home-row">
              <span class="home-date"><i class="fa-regular fa-calendar"></i> <span id="todayDate">2024-06-01 周六</span></span>
              <span class="home-weather"><i class="fa-solid fa-cloud-sun"></i> 26°C 晴</span>
            </div>
            <div class="home-quote">“每一天都是新的开始，保持微笑。”</div>
          </div>
          <div class="home-card">
            <div class="mood-summary" id="moodSummary">
              <span class="fa-regular fa-face-smile"></span>
              <span class="summary-text">今日还未记录心情，快来分享你的心情吧！</span>
            </div>
            <button class="edit-btn" onclick="showPage('editPage')"><i class="fa-solid fa-pen"></i> 记录今日心情</button>
          </div>
          <div class="home-card">
            <div class="date-picker">
              <label style="font-size:15px;color:#888;">查看历史：</label>
              <input type="date" id="datePicker" value="2024-06-01" onchange="showHistory()">
            </div>
          </div>
          <div class="trend-card">
            <i class="fa-solid fa-chart-line"></i> 今日心情趋势：<span style="color:#ffb347;">平稳向上</span>
          </div>
        </div>
      </div>
      <!-- 编辑页 -->
      <div class="page" id="editPage">
        <div class="page-inner-card">
          <h2>记录今日心情</h2>
          <form id="moodForm" onsubmit="submitMood(event)">
            <div class="form-group">
              <label for="moodText">心情描述（必填，200字内）</label>
              <textarea id="moodText" maxlength="200" required placeholder="写下你的心情..." ></textarea>
            </div>
            <div class="form-group">
              <label>自拍上传（可选）</label>
              <input type="file" accept="image/*">
            </div>
            <div class="form-group">
              <label>语音上传（可选，最长60秒）</label>
              <input type="file" accept="audio/*">
            </div>
            <div class="form-group">
              <label>选择情绪</label>
              <div class="emotion-row">
                <span class="fa-regular fa-face-smile selected"></span>
                <span class="fa-regular fa-face-meh"></span>
                <span class="fa-regular fa-face-frown"></span>
                <span class="fa-regular fa-face-surprise"></span>
                <span class="fa-regular fa-face-grin-stars"></span>
              </div>
            </div>
            <div class="form-group">
              <label>情绪强度</label>
              <div class="slider-row">
                <span><i class="fa-solid fa-bolt"></i></span>
                <input type="range" min="1" max="10" value="5">
                <span id="intensityValue">5</span>
              </div>
            </div>
            <div class="form-group">
              <label for="goal">关联目标（可选）</label>
              <input type="text" id="goal" placeholder="如：记录每一次微笑和感动...">
            </div>
            <div class="form-actions">
              <button type="submit" class="submit">发布</button>
              <button type="button" class="cancel" onclick="showPage('homePage')">取消</button>
            </div>
          </form>
        </div>
      </div>
      <!-- AI分析结果页 -->
      <div class="page" id="aiPage">
        <div class="page-inner-card">
          <div class="ai-result">
            <span class="fa-regular fa-face-smile"></span>
            <div class="score">情绪分数：8.5</div>
            <div class="tags">
              <span class="tag">开心</span>
              <span class="tag">元气满满</span>
            </div>
            <div class="desc">今天你是阳光小太阳，继续保持好心情！</div>
            <button class="edit-btn" style="margin-top:32px;" onclick="showPage('homePage')"><i class="fa-solid fa-house"></i> 返回首页</button>
          </div>
        </div>
      </div>
      <!-- 历史心情页 -->
      <div class="page" id="historyPage">
        <div class="page-inner-card">
          <h2>历史心情记录</h2>
          <div class="date-picker">
            <input type="date" id="historyDatePicker" value="2024-06-01" onchange="showHistory()">
          </div>
          <div class="history-list">
            <div class="history-item">
              <span class="date">2024-05-31</span>
              <span class="summary">平静如水</span>
              <span class="fa-solid fa-trash" title="删除"></span>
            </div>
            <div class="history-item">
              <span class="date">2024-05-30</span>
              <span class="summary">有点小郁闷</span>
              <span class="fa-solid fa-trash" title="删除"></span>
            </div>
            <div class="history-item">
              <span class="date">2024-05-29</span>
              <span class="summary">元气满满</span>
              <span class="fa-solid fa-trash" title="删除"></span>
            </div>
          </div>
          <button class="edit-btn" style="margin-top:24px;" onclick="showPage('homePage')"><i class="fa-solid fa-house"></i> 返回首页</button>
        </div>
      </div>
      <!-- 登录/隐私页 -->
      <div class="page" id="loginPage">
        <div class="page-inner-card">
          <div class="login-box">
            <span class="fa-regular fa-user-circle"></span>
            <div style="font-size:20px; margin:12px 0;">微信一键登录</div>
            <button onclick="showPage('homePage')"><i class="fa-brands fa-weixin"></i> 微信登录</button>
          </div>
          <div class="privacy">所有心情数据仅本人可见，支持一键删除全部数据，严格保护隐私。</div>
        </div>
      </div>
      <!-- 底部导航 -->
      <nav>
        <button id="navHome" class="active" onclick="showPage('homePage')"><i class="fa-solid fa-house-chimney"></i><br>首页</button>
        <button id="navEdit" onclick="showPage('editPage')"><i class="fa-regular fa-pen-to-square"></i><br>记录</button>
        <button id="navHistory" onclick="showPage('historyPage')"><i class="fa-regular fa-clock"></i><br>历史</button>
        <button id="navLogin" onclick="showPage('loginPage')"><i class="fa-solid fa-user-astronaut"></i><br>我的</button>
      </nav>
    </div>
  </div>
  <script>
    // 页面切换
    function showPage(pageId) {
      document.querySelectorAll('.page').forEach(p => p.classList.remove('active'));
      document.getElementById(pageId).classList.add('active');
      document.querySelectorAll('nav button').forEach(btn => btn.classList.remove('active'));
      if(pageId==='homePage') document.getElementById('navHome').classList.add('active');
      if(pageId==='editPage') document.getElementById('navEdit').classList.add('active');
      if(pageId==='historyPage') document.getElementById('navHistory').classList.add('active');
      if(pageId==='loginPage') document.getElementById('navLogin').classList.add('active');
    }
    // 默认显示首页
    showPage('homePage');
    // 情绪强度滑块
    document.querySelectorAll('input[type="range"]').forEach(slider => {
      slider.oninput = function() {
        this.nextElementSibling.innerText = this.value;
      }
    });
    // 表单提交模拟AI分析
    function submitMood(e) {
      e.preventDefault();
      showPage('aiPage');
    }
    // 日期选择器跳转历史
    function showHistory() {
      showPage('historyPage');
    }
  </script>
</body>
</html> 